/*
 Navicat Premium Data Transfer

 Source Server         : demo
 Source Server Type    : MySQL
 Source Server Version : 80031
 Source Host           : localhost:3306
 Source Schema         : traceability

 Target Server Type    : MySQL
 Target Server Version : 80031
 File Encoding         : 65001

 Date: 06/04/2023 10:41:58
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_backups
-- ----------------------------
DROP TABLE IF EXISTS `sys_backups`;
CREATE TABLE `sys_backups` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `backuptime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '数据库备份时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='数据库备份记录表';

-- ----------------------------
-- Records of sys_backups
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '内容',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '类型'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of sys_dict
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
-- DROP TABLE IF EXISTS `sys_menu`;
-- CREATE TABLE `sys_menu` (
--   `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
--   `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
--   `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '路径',
--   `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图标',
--   `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '描述',
--   `pid` int DEFAULT NULL COMMENT '父级id',
--   `page_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '页面路径',
--   `sort_num` int DEFAULT NULL COMMENT '排序',
--   PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
-- BEGIN;
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (4, '系统管理', NULL, 'el-icon-s-grid', NULL, NULL, NULL, 300);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (5, '用户管理', '/user', 'el-icon-user', NULL, 4, 'User', 301);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (6, '角色管理', '/role', 'el-icon-s-custom', NULL, 4, 'Role', 302);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (7, '菜单管理', '/menu', 'el-icon-menu', NULL, 4, 'Menu', 303);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (10, '主页', '/home', 'el-icon-house', NULL, NULL, 'Home', 0);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (16, '医废溯源', NULL, 'el-icon-house', '1', NULL, '', 4);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (17, '医废信息表', '/wasteInfo', 'el-icon-document', NULL, 16, 'WasteInfo', 1);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (18, '医废处理流程', '/topology', 'el-icon-document', NULL, 16, 'Topology', 3);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (19, '转运车辆路径', '/wasteTransport', 'el-icon-s-grid', NULL, 16, 'WasteTransport', 8);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (20, '医废异常', NULL, 'el-icon-menu', NULL, NULL, NULL, 4);
-- INSERT INTO `sys_menu` (`id`, `name`, `path`, `icon`, `description`, `pid`, `page_path`, `sort_num`) VALUES (21, '异常情况', '/abnormal', NULL, NULL, 20, 'Abnormal', NULL);
-- COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '描述',
  `flag` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '唯一标识',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`id`, `name`, `description`, `flag`) VALUES (1, '内部人员', '内部人员', 'ROLE_ADMIN');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `role_id` int NOT NULL COMMENT '角色id',
  `menu_id` int NOT NULL COMMENT '菜单id',
  PRIMARY KEY (`role_id`,`menu_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='角色菜单关系表';

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 10);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 16);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 17);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 18);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 19);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 20);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, 21);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 10);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 16);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 17);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 18);
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户名',
  `password` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '密码',
  `nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '昵称',
  `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '邮箱',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '电话',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '角色',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of sys_user  
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`id`, `username`, `password`, `nickname`, `email`, `phone`, `create_time`, `role`) VALUES (1, 'admin', '123456', '管理员', '123@qq.com', NULL, '2023-02-14 19:23:33', 'ROLE_ADMIN');
INSERT INTO `sys_user` (`id`, `username`, `password`, `nickname`, `email`, `phone`, `create_time`, `role`) VALUES (24, 'chenhui', '123456', NULL, NULL, NULL, '2023-03-06 22:09:45', 'ROLE_ADMIN');
COMMIT;

-- ----------------------------
-- Table structure for sys_waste_info
-- ----------------------------
DROP TABLE IF EXISTS `sys_waste_info`;
CREATE TABLE `sys_waste_info` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `classification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分类',
  `department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '科室',
  `weight` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '重量',
  `recycle_person_id` int DEFAULT NULL COMMENT '回收人员id',
  `recycle_time` datetime DEFAULT NULL COMMENT '回收时间',
  `transfer_record_id` int DEFAULT NULL COMMENT '转运记录id',
  `create_time` datetime DEFAULT NULL COMMENT '接收时间',
  `archived` int DEFAULT NULL COMMENT '已处理归档',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='医疗废弃物包裹信息表';

-- ----------------------------
-- Records of sys_waste_info
-- ----------------------------
BEGIN;
INSERT INTO `sys_waste_info` (`id`, `classification`, `department`, `weight`, `recycle_person_id`, `recycle_time`, `transfer_record_id`, `create_time`, `status`, `archived`) VALUES (1, '感染性废物', '急诊科', '1.6', 1, '2023-02-11 15:56:51', 1, '2023-03-01 14:22:23', '', 0);
INSERT INTO `sys_waste_info` (`id`, `classification`, `department`, `weight`, `recycle_person_id`, `recycle_time`, `transfer_record_id`, `create_time`, `status`, `archived`) VALUES (2, '病理性废物', '内科', '1.2', 2, '2023-02-02 15:57:27', 2, '2023-03-02 14:22:23', '', 0);
INSERT INTO `sys_waste_info` (`id`, `classification`, `department`, `weight`, `recycle_person_id`, `recycle_time`, `transfer_record_id`, `create_time`, `status`, `archived`) VALUES (3, '药物性废物', '外科', '1.5', 3, '2023-02-10 15:57:55', 3, '2023-03-03 14:22:23', '', 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_waste_receive
-- ----------------------------
DROP TABLE IF EXISTS `sys_waste_receive`;
CREATE TABLE `sys_waste_receive` (
  `package_id` int NOT NULL AUTO_INCREMENT COMMENT '处理包裹id',
  `receiver_id` int DEFAULT NULL COMMENT '处理站接收人员id',
  `receive_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '处理接收时间',
  `receive_weight` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '接收重量',
  PRIMARY KEY (`package_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='处理站接收信息表';

-- ----------------------------
-- Records of sys_waste_receive
-- ----------------------------
BEGIN;
INSERT INTO `sys_waste_receive` (`package_id`, `receiver_id`, `receive_time`, `receive_weight`) VALUES (1, 1, '2022-12-12', '200');
INSERT INTO `sys_waste_receive` (`package_id`, `receiver_id`, `receive_time`, `receive_weight`) VALUES (2, 2, '2023-01-01', '300');
INSERT INTO `sys_waste_receive` (`package_id`, `receiver_id`, `receive_time`, `receive_weight`) VALUES (3, 3, '2023-02-02', '300');
COMMIT;

-- ----------------------------
-- Table structure for sys_waste_staging
-- ----------------------------
DROP TABLE IF EXISTS `sys_waste_staging`;
CREATE TABLE `sys_waste_staging` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `package_id` int DEFAULT NULL COMMENT 'package_id',
  `receive_time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '接收时间',
  `receive_weight` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '接收重量',
  `receiver_id` int DEFAULT NULL COMMENT '接收人员id',
  `out_time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '运出时间',
  `out_weight` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '运出重量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='医疗废物暂存信息表';

-- ----------------------------
-- Records of sys_waste_staging
-- ----------------------------
BEGIN;
INSERT INTO `sys_waste_staging` (`package_id`, `receive_time`, `receive_weight`, `receiver_id`, `out_time`, `out_weight`) VALUES (1, '2023-02-12 19:09:04', '10', 1, '2023-02-12 19:09:10', '20');
INSERT INTO `sys_waste_staging` (`package_id`, `receive_time`, `receive_weight`, `receiver_id`, `out_time`, `out_weight`) VALUES (2, '2023-02-14 19:50:40', '30', 2, '2023-02-14 19:50:46', '30');
INSERT INTO `sys_waste_staging` (`package_id`, `receive_time`, `receive_weight`, `receiver_id`, `out_time`, `out_weight`) VALUES (3, '2023-02-14 19:50:54', '30', 3, '2023-02-14 19:51:00', '28');
COMMIT;

-- ----------------------------
-- Table structure for sys_waste_transport
-- ----------------------------
DROP TABLE IF EXISTS `sys_waste_transport`;
CREATE TABLE `sys_waste_transport` (
  `record_id` int NOT NULL AUTO_INCREMENT COMMENT '转运记录id',
  `package_id` int DEFAULT NULL COMMENT '包裹id',
  `transfer_person_id` int DEFAULT NULL COMMENT '转运人员id',
  `transfer_vehicle_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '转运车辆牌照',
  `track_points` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '车辆轨迹坐标',
  `start_time` datetime DEFAULT NULL COMMENT '出发时间',
  `end_time` datetime DEFAULT NULL COMMENT '到达时间',
  PRIMARY KEY (`record_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='医疗废物转运信息表';

-- ----------------------------
-- Records of sys_waste_transport
-- ----------------------------
BEGIN;
-- INSERT INTO `sys_waste_transport` (`record_id`, `transfer_person_id`, `transfer_vehicle_id`, `track_points`, `start_time`, `end_time`) VALUES (1, 1, '京A88888', '[[118.780975,30.942148],[118.782563,30.942276],[118.785309,30.94246],[118.785288,30.941191],[118.784687,30.939939]]', '2023-02-12 20:24:40', '2023-02-14 20:24:42');
-- INSERT INTO `sys_waste_transport` (`record_id`, `transfer_person_id`, `transfer_vehicle_id`, `track_points`, `start_time`, `end_time`) VALUES (2, 2, '京A66666', '[[118.780932,30.942111],[118.782413,30.94224],[118.785267,30.942387],[118.787949,30.942552],[118.790609,30.942718]]', '2023-02-13 10:41:48', '2023-02-15 10:41:50');
-- INSERT INTO `sys_waste_transport` (`record_id`, `transfer_person_id`, `transfer_vehicle_id`, `track_points`, `start_time`, `end_time`) VALUES (3, 3, '京A99999', '[[118.780975,30.942148],[ 118.782563,30.942276],[118.785309,30.94246],[118.785288,30.941191],[118.784687,30.939939]]', '2023-02-14 10:44:13', '2023-02-15 10:44:17');
COMMIT;

-- ----------------------------
-- Table structure for sys_work_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_work_user`;
CREATE TABLE `sys_work_user` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '工作人员姓名',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '工作人员手机号',
  `role` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '权限',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='工作人员信息表';

-- ----------------------------
-- Records of sys_work_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_work_user` (`id`, `name`, `phone`, `role`) VALUES (1, '张三', '17616529998', '暂存人员');
INSERT INTO `sys_work_user` (`id`, `name`, `phone`, `role`) VALUES (2, '李四', '17876543572', '转运人员');
INSERT INTO `sys_work_user` (`id`, `name`, `phone`, `role`) VALUES (3, '老六', '13465789876', '处理人员');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
